<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
        xmlns:xhtml="http://www.w3.org/1999/xhtml">

    {%- assign pages=site.pages | where: "sitemap_include", true | where: "lang", page.lang %}
    {%- for page in pages %}
    {%- assign page_canonical_url = page.url | regex_replace_once: '^\/?(en\/|ru\/)', '' | relative_url %}
    <url>
        <loc>{{ site.urls[page.lang] }}{{ site.canonical_url_prefix }}{{ page_canonical_url }}</loc>
        <xhtml:link rel="alternate" hreflang="ru" href="{{ site.urls['ru'] }}{{ site.canonical_url_prefix }}{{ page_canonical_url }}" />
        <xhtml:link rel="alternate" hreflang="en" href="{{ site.urls['en'] }}{{ site.canonical_url_prefix }}{{ page_canonical_url }}" />
        <lastmod>{{site.time | date: '%Y-%m-%d' }}</lastmod>
        <changefreq>daily</changefreq>
        <priority>0.5</priority>
    </url>
    {%- endfor %}
</urlset>
